import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { TitleItem } from "./item/TitleItem";
import { GBox } from "../../../../com/mui/containers/GBox";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { TextAlign } from "../../../../flashx/textLayout/formats/TextAlign";
import { ObjCreate } from "./ObjCreate";
import { Vector } from "../../../../__AS3__/vec/Vector";
//class ObjTeamCreate
    
    export  class ObjTeamCreate
    {
        

        public static setTextFieldKeyValue(arg1: Object /* flash.text.TextField */, arg2: string, arg3: string="", arg4: string="", arg5: string=""): void
        {
            if (!arg4) 
            {
                arg4 = GlobalStyle.color1;
            }
            if (!arg5) 
            {
                arg5 = GlobalStyle.color2;
            }
            arg1.htmlText = HTMLUtil.addColor(arg2, arg4) + HTMLUtil.addColor(arg3, arg5);
            return;
        }

        public static createTitles(arg1: Vector.<TitleItem>, arg2: Object /* flash.text.TextFormat */=null): GBox
        {
            if (!arg2) 
            {
                arg2 = new GTextFormat(FontUtil.songtiName, 12, GlobalStyle.color2Uint);
                arg2.align = TextAlign.CENTER;
            }
            var loc1=new GBox();
            var loc2=0;
            while (loc2 < arg1.length) 
            {
                ObjCreate.createTextField(arg1[loc2].titleName, 0, 0, arg1[loc2].width, 20, loc1, arg2);
                ++loc2;
            }
            return loc1;
        }
    }
